Fix Nuclei deduplication across multiple endpoints - #15851
Open
Jaimin2687 wants to merge 3 commits into
Open
Conversation
…12397) This commit addresses the issue where Nuclei findings from different hosts were incorrectly deduplicated into a single finding. Two main fixes were implemented: 1. dojo/tools/nuclei/parser.py: Fixed dupe_host extraction for protocol-less URLs by parsing them similarly to how LocationData operates, ensuring different hosts generate distinct dupe_key values. 2. dojo/importers/default_reimporter.py & dojo/finding/deduplication.py: Added endpoint differentiation via are_locations_duplicates during re-import matching to prevent incorrect merging of findings with identical hash codes but distinct endpoints. Extended finding_locations to correctly parse LocationData DTOs.
|
This pull request contains critical findings because the user 'Jaimin2687', who is not on the allowed authors list, modified sensitive codepaths in
🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in
|
| Vulnerability | Configured Sensitive Codepath Modified by Non-Allowed Author |
|---|---|
| Description | File 'dojo/finding/deduplication.py' matches configured sensitive codepath pattern 'dojo/finding/*.py' and was modified by 'Jaimin2687' (commit d5f8c60) who is not in the allowed authors list. |
🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in dojo/importers/default_reimporter.py (drs_60f4c536)
| Vulnerability | Configured Sensitive Codepath Modified by Non-Allowed Author |
|---|---|
| Description | File 'dojo/importers/default_reimporter.py' matches configured sensitive codepath pattern 'dojo/importers/*.py' and was modified by 'Jaimin2687' (commit d5f8c60) who is not in the allowed authors list. |
We've notified @mtesauro.
Comment to provide feedback on these findings.
Report false positive: @dryrunsecurity fp [FINDING ID] [FEEDBACK]
Report low-impact: @dryrunsecurity nit [FINDING ID] [FEEDBACK]
Example: @dryrunsecurity fp drs_90eda195 This code is not user-facing
All finding details can be found in the DryRun Security Dashboard.
The are_locations_duplicates check in match_finding_to_candidate_reimport incorrectly rejected hash_code matches between findings in the same report that have different endpoints but should merge (endpoint accumulation). This broke test_reimport_prefetch tests that rely on same-hash findings within one report being matched so their endpoints accumulate on a single finding. The parser fix (dupe_host extraction for protocol-less URLs) alone is sufficient to resolve DefectDojo#12397 — it ensures different hosts produce distinct hash codes, preventing incorrect deduplication at the source.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12397
Description
This PR addresses the issue where Nuclei findings from different hosts were being incorrectly deduplicated into a single finding.
Root Cause
Protocol-less URLs (e.g.
amazon.com) causedurlparse(matched).hostnameto returnNoneindojo/tools/nuclei/parser.py. This resulted in different hosts sharing the samedupe_key, which in turn collapsed them into a singlehash_codeduring dedup — merging findings that should have remained distinct.Fix
Pre-pend
//to protocol-less URLs beforeurlparse()so the hostname is correctly extracted. This mirrors the existing pattern used forLocationDataconstruction on line 91 of the same file.With this fix,
urlparse("//amazon.com").hostnamecorrectly returns"amazon.com"(instead ofNone), and each host produces a distinctdupe_key→ distincthash_code→ no incorrect deduplication.Checklist